package com.ruoyi.web.controller.store;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.store.domain.HardCounts;
import com.ruoyi.store.domain.PaperCounts;
import com.ruoyi.store.domain.QuesCounts;
import com.ruoyi.store.service.IMemberService;
import com.ruoyi.store.service.IStuExamDetailService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/echarts")
public class EchartsContoller extends BaseController {

    @Resource
    private IMemberService memberServiceService;

    @GetMapping("/getQuesCounts")
    public AjaxResult paperCount(QuesCounts quesCounts){
        QuesCounts quesCounts1 = memberServiceService.selectQuesCounts(quesCounts);
        System.out.println(quesCounts1);
        return AjaxResult.success(quesCounts1);
    }

    @GetMapping("/getQuesHardCounts")
    public AjaxResult QuesHardCount(HardCounts hardCounts){
        return AjaxResult.success(memberServiceService.selectHardCounts(hardCounts));
    }

    /**
     * 根据试卷id进行统计
     * @param paperId
     * @return
     */
    @GetMapping("/getPaperCounts")
    public AjaxResult PaperCount(Long paperId){
        return AjaxResult.success(memberServiceService.selectPaperCounts(paperId));
    }

    @GetMapping("/getIndexCounts")
    public AjaxResult IndexCount(){
        return AjaxResult.success(memberServiceService.selectIndexCounts());
    }


}
